package com.springmvc.utils.result;

import com.springmvc.entity.MethodEnum;

public class ResultMsg {

	private boolean	success;

	private String	code;

	private String	msg;

	private int		cammand;

	private Object	data;

	public ResultMsg() {
		this.setCode("");
		this.setMsg("");
		this.setSuccess(false);
	}

	public boolean isSuccess() {
		return success;
	}

	public String getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getCammand() {
		return cammand;
	}

	public void setCammand(int cammand) {
		this.cammand = cammand;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public ResultMsg(boolean success, String code, String msg, int cammand, Object data) {
		super();
		this.success = success;
		this.code = code;
		this.msg = msg;
		this.cammand = cammand;
		this.data = data;
	}

	public static ResultMsg SUCCESS(int cammand, Object data) {
		ResultMsg resultMsg = new ResultMsg();
		resultMsg.setSuccess(true);
		resultMsg.setCode("0000");
		resultMsg.setMsg("成功");
		resultMsg.setCammand(cammand);
		resultMsg.setData(data);
		return resultMsg;
	}

}
